﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ExcellentCRM.DataService.Models
{
    /// <summary>
    /// 班内分组
    /// </summary>
    public class Group : BaseModel
    {
        [Required(AllowEmptyStrings = false)]
        [StringLength(30)]
        public string GroupName { get; set; }

        public long GradeId { get; set; }

        public long LeaderId { get; set; }

        /// <summary>
        /// 所属班级
        /// </summary>
        [ForeignKey("GradeId")]
        public Grade Grade { get; set; }

        /// <summary>
        /// 组长
        /// </summary>
        [ForeignKey("LeaderId")]
        public StuClient Leader { get; set; }

        public virtual IList<StuClient> StuClients { get; set; }
    }
}